import request from '@/utils/request'

// 获取银行列表
export function getBankList(query) {
  return request({
    url: '/system/bank/paging',
    method: 'get',
    params: query
  })
}

// 删除银行
export function deleteBank(bankId) {
  if (!bankId) {
    return false
  }
  return request({
    url: '/system/bank/delete',
    method: 'get',
    params: { bankId }
  })
}

// 获取银行信息
export function getBank(bankId) {
  const params = {}
  if (bankId) {
    params.bankId = bankId
  }
  return request({
    url: '/system/bank/getBank',
    method: 'get',
    params: params
  })
}

// 保存银行信息，传复杂对象，参数用data
export function saveBank(bank) {
  return request({
    url: '/system/bank/save',
    method: 'post',
    data: bank
  })
}

